import { c as create_ssr_component, o as onDestroy, v as validate_component, m as missing_component, e as escape, n as null_to_empty, a as subscribe, s as setContext, b as each, d as add_styles, f as add_attribute } from "../../chunks/index2.js";
import { g as getNotificationsContext, s as store, c as context, p as positions, o as open } from "../../chunks/Scrollbar.svelte_svelte_type_style_lang.js";
import { S as Scrollbar } from "../../chunks/Scrollbar.js";
const tailwind = "";
const app = "";
const Notification = create_ssr_component(($$result, $$props, $$bindings, slots) => {
  let { item } = $$props;
  let { notification = {} } = $$props;
  let { withoutStyles = false } = $$props;
  const { removeNotification } = getNotificationsContext();
  const { id, removeAfter } = notification;
  const removeNotificationHandler = () => removeNotification(id);
  let timeout = null;
  if (removeAfter) {
    timeout = setTimeout(removeNotificationHandler, removeAfter);
  }
  onDestroy(() => {
    if (removeAfter && timeout)
      clearTimeout(timeout);
  });
  if ($$props.item === void 0 && $$bindings.item && item !== void 0)
    $$bindings.item(item);
  if ($$props.notification === void 0 && $$bindings.notification && notification !== void 0)
    $$bindings.notification(notification);
  if ($$props.withoutStyles === void 0 && $$bindings.withoutStyles && withoutStyles !== void 0)
    $$bindings.withoutStyles(withoutStyles);
  return `${validate_component(item || missing_component, "svelte:component").$$render(
    $$result,
    {
      notification,
      withoutStyles,
      onRemove: removeNotificationHandler
    },
    {},
    {}
  )}`;
});
const css$1 = {
  code: ".default-notification-style.svelte-1x27qg3.svelte-1x27qg3{position:relative;display:flex;align-items:stretch;justify-content:space-between;margin:12px;background:#fff;color:#000;border-radius:6px;box-shadow:0 4px 10px rgba(0, 0, 0, 0.08);min-height:0;min-width:200px;overflow:hidden}.default-notification-style-content.svelte-1x27qg3.svelte-1x27qg3{width:210px;padding:12px 6px 12px 12px;box-sizing:border-box;word-wrap:break-word}.default-notification-style-button.svelte-1x27qg3.svelte-1x27qg3{display:block;width:40px;padding:0;margin:0;border:none;border-left:1px solid #eee;outline:none;background:none;cursor:pointer;font-size:20px;color:#000;box-sizing:border-box}.default-notification-style-button.svelte-1x27qg3.svelte-1x27qg3:hover{background:rgba(0, 0, 0, 0.01)}.default-notification-error.svelte-1x27qg3.svelte-1x27qg3{background:#f3555a;color:#fff}.default-notification-error.svelte-1x27qg3 .default-notification-style-button.svelte-1x27qg3{border-left:1px solid rgba(255, 255, 255, 0.4);color:#fff}.default-notification-warning.svelte-1x27qg3.svelte-1x27qg3{background:#ffb900;color:#000}.default-notification-warning.svelte-1x27qg3 .default-notification-style-button.svelte-1x27qg3{border-left:1px solid rgba(0, 0, 0, 0.2);color:#000}.default-notification-success.svelte-1x27qg3.svelte-1x27qg3{background:#22ce6c;color:#fff}.default-notification-success.svelte-1x27qg3 .default-notification-style-button.svelte-1x27qg3{border-left:1px solid rgba(255, 255, 255, 0.4);color:#fff}",
  map: null
};
const DefaultNotification = create_ssr_component(($$result, $$props, $$bindings, slots) => {
  let { notification = {} } = $$props;
  let { withoutStyles = false } = $$props;
  let { onRemove = null } = $$props;
  const { text, type } = notification;
  const getClass = (suffix) => {
    const defaultSuffix = suffix ? `-${suffix}` : "";
    const defaultNotificationClass = ` default-notification-style${defaultSuffix}`;
    const defaultNotificationType = type && !suffix ? ` default-notification-${type}` : "";
    return `notification${defaultSuffix}${withoutStyles ? "" : defaultNotificationClass}${defaultNotificationType}`;
  };
  if ($$props.notification === void 0 && $$bindings.notification && notification !== void 0)
    $$bindings.notification(notification);
  if ($$props.withoutStyles === void 0 && $$bindings.withoutStyles && withoutStyles !== void 0)
    $$bindings.withoutStyles(withoutStyles);
  if ($$props.onRemove === void 0 && $$bindings.onRemove && onRemove !== void 0)
    $$bindings.onRemove(onRemove);
  $$result.css.add(css$1);
  return `${text ? `<div class="${escape(null_to_empty(getClass()), true) + " svelte-1x27qg3"}" role="status" aria-live="polite"><div class="${escape(null_to_empty(getClass("content")), true) + " svelte-1x27qg3"}">${slots.default ? slots.default({}) : `${escape(text)}`}</div>
    <button class="${escape(null_to_empty(getClass("button")), true) + " svelte-1x27qg3"}" aria-label="delete notification">×
    </button></div>` : ``}`;
});
const css = {
  code: ".default-position-style-top-left.svelte-t0tmtn,.default-position-style-top-center.svelte-t0tmtn,.default-position-style-top-right.svelte-t0tmtn,.default-position-style-bottom-left.svelte-t0tmtn,.default-position-style-bottom-center.svelte-t0tmtn,.default-position-style-bottom-right.svelte-t0tmtn{position:fixed;max-width:400px}.default-position-style-top-left.svelte-t0tmtn{top:0;left:0}.default-position-style-top-center.svelte-t0tmtn{top:0;left:50%;transform:translateX(-50%)}.default-position-style-top-right.svelte-t0tmtn{top:0;right:0}.default-position-style-bottom-left.svelte-t0tmtn{bottom:0;left:0}.default-position-style-bottom-center.svelte-t0tmtn{bottom:0;left:50%;transform:translateX(-50%)}.default-position-style-bottom-right.svelte-t0tmtn{bottom:0;right:0}",
  map: null
};
const Notifications = create_ssr_component(($$result, $$props, $$bindings, slots) => {
  let $store, $$unsubscribe_store;
  $$unsubscribe_store = subscribe(store, (value) => $store = value);
  let { item = null } = $$props;
  let { withoutStyles = false } = $$props;
  let { zIndex = null } = $$props;
  const getClass = (position = "") => {
    const defaultPositionClass = ` default-position-style-${position}`;
    return `position-${position}${withoutStyles ? "" : defaultPositionClass}`;
  };
  setContext(context, store);
  if ($$props.item === void 0 && $$bindings.item && item !== void 0)
    $$bindings.item(item);
  if ($$props.withoutStyles === void 0 && $$bindings.withoutStyles && withoutStyles !== void 0)
    $$bindings.withoutStyles(withoutStyles);
  if ($$props.zIndex === void 0 && $$bindings.zIndex && zIndex !== void 0)
    $$bindings.zIndex(zIndex);
  $$result.css.add(css);
  $$unsubscribe_store();
  return `${slots.default ? slots.default({}) : ``}
<div class="notifications">${each(positions, (position) => {
    return `<div class="${escape(null_to_empty(getClass(position)), true) + " svelte-t0tmtn"}"${add_styles({ "z-index": zIndex })}>${each($store, (notification) => {
      return `${notification.position === position ? `${validate_component(Notification, "Notification").$$render(
        $$result,
        {
          notification,
          withoutStyles,
          item: item || DefaultNotification
        },
        {},
        {}
      )}` : ``}`;
    })}
    </div>`;
  })}</div>`;
});
const Layout = create_ssr_component(($$result, $$props, $$bindings, slots) => {
  let $$unsubscribe_open;
  $$unsubscribe_open = subscribe(open, (value) => value);
  let root;
  $$unsubscribe_open();
  return `



<div class="h-full overflow-hidden relative"${add_attribute("this", root, 0)}><div class="h-full flex items-start"><div class="relative flex flex-col h-full pl-0 w-full bg-white">${validate_component(Scrollbar, "Scrollbar").$$render(
    $$result,
    {
      className: "h-0 grow ",
      classLayout: "h-full",
      alwaysVisible: false
    },
    {},
    {
      default: () => {
        return `${slots.default ? slots.default({}) : ``}`;
      }
    }
  )}</div></div></div>`;
});
const Layout_1 = create_ssr_component(($$result, $$props, $$bindings, slots) => {
  return `



${validate_component(Notifications, "Notifications").$$render($$result, {}, {}, {
    default: () => {
      return `${validate_component(Layout, "Layout").$$render($$result, {}, {}, {
        default: () => {
          return `<div class="flex h-full flex-col"><div class="h-0 grow bg-white lg:rounded-tl-3xl">${slots.default ? slots.default({}) : ``}</div></div>`;
        }
      })}`;
    }
  })}`;
});
export {
  Layout_1 as default
};
